+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
static void gtk_im_multicontext_reset (GtkIMContext *context);
static void gtk_im_multicontext_set_cursor_location (GtkIMContext *context,
GdkRectangle *area);
+static void gtk_im_multicontext_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit);
static gboolean gtk_im_multicontext_get_surrounding (GtkIMContext *context,
gchar **text,
gint *cursor_index);
im_context_class->focus_out = gtk_im_multicontext_focus_out;
im_context_class->reset = gtk_im_multicontext_reset;
im_context_class->set_cursor_location = gtk_im_multicontext_set_cursor_location;
+ im_context_class->set_use_preedit = gtk_im_multicontext_set_use_preedit;
im_context_class->set_surrounding = gtk_im_multicontext_set_surrounding;
im_context_class->get_surrounding = gtk_im_multicontext_get_surrounding;
gtk_im_context_set_cursor_location (slave, area);
}
+static void
+gtk_im_multicontext_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit)
+{
+ GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
+ GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
+
+ if (slave)
+ gtk_im_context_set_use_preedit (slave, use_preedit);
+}
+
static gboolean
gtk_im_multicontext_get_surrounding (GtkIMContext *context,
gchar **text,
static void gtk_im_context_xim_focus_out (GtkIMContext *context);
static void gtk_im_context_xim_set_cursor_location (GtkIMContext *context,
GdkRectangle *area);
+static void gtk_im_context_xim_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit);
static void gtk_im_context_xim_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs,
im_context_class->focus_in = gtk_im_context_xim_focus_in;
im_context_class->focus_out = gtk_im_context_xim_focus_out;
im_context_class->set_cursor_location = gtk_im_context_xim_set_cursor_location;
+ im_context_class->set_use_preedit = gtk_im_context_xim_set_use_preedit;
gobject_class->finalize = gtk_im_context_xim_finalize;
}
static void
gtk_im_context_xim_init (GtkIMContextXIM *im_context_xim)
{
+ im_context_xim->use_preedit = TRUE;
}
static void
}
static void
-gtk_im_context_xim_set_client_window (GtkIMContext *context,
- GdkWindow *client_window)
+reinitialize_ic (GtkIMContextXIM *context_xim)
{
- GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
-
if (context_xim->ic)
{
XDestroyIC (context_xim->ic);
context_xim->ic = NULL;
+
+ if (context_xim->preedit_length)
+ {
+ context_xim->preedit_length = 0;
+ g_signal_emit_by_name (context_xim, "preedit_changed");
+ }
}
+}
+static void
+gtk_im_context_xim_set_client_window (GtkIMContext *context,
+ GdkWindow *client_window)
+{
+ GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
+
+ reinitialize_ic (context_xim);
context_xim->client_window = client_window;
}
return;
}
+static void
+gtk_im_context_xim_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit)
+{
+ GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
+
+ use_preedit = use_preedit != FALSE;
+
+ if (context_xim->use_preedit != use_preedit)
+ {
+ context_xim->use_preedit = use_preedit;
+ reinitialize_ic (context_xim);
+ }
+
+ return;
+}
+
static void
gtk_im_context_xim_reset (GtkIMContext *context)
{
if (!context_xim->ic && context_xim->client_window)
{
+ if (!context_xim->use_preedit)
+ {
+ context_xim->ic = XCreateIC (context_xim->im_info->im,
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow, GDK_DRAWABLE_XID (context_xim->client_window),
+ NULL);
+ return context_xim->ic;
+ }
+
if ((context_xim->im_info->style & PREEDIT_MASK) == XIMPreeditCallbacks)
{
context_xim->preedit_start_callback.client_data = (XPointer)context_xim;
XIMCallback status_draw_callback;
XIC ic;
+
+ guint use_preedit : 1;
};
struct _GtkIMContextXIMClass